package org.example.diet_compass.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jakarta.annotation.Resource;
import org.example.diet_compass.domain.Scores;
import org.example.diet_compass.mapper.ScoresMapper;
import org.example.diet_compass.service.ScoresService;
import org.springframework.stereotype.Service;

/**
* @author 86135
* @description 针对表【scores(评分表)】的数据库操作Service实现
* @createDate 2025-03-04 08:04:21
*/
@Service
public class ScoresServiceImpl extends ServiceImpl<ScoresMapper, Scores>
    implements ScoresService {

    @Resource
    private ScoresMapper scoresMapper;

    @Override
    public Integer getGoodScoreNums(String goodsId) {
        return scoresMapper.getGoodScoreNums(goodsId);
    }

    @Override
    public Integer getScoreByGoodIdAndUserId(String goodId, Integer userId) {
        return scoresMapper.getScoreByGoodIdAndUserId(goodId, userId);
    }

    @Override
    public Scores selectByGoodIdAndUserId(String goodsId, Integer userId) {
       return scoresMapper.selectByGoodIdAndUserId(goodsId,userId);
    }
}




